<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>客户信息列表</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <h2 class="mb-4">客户信息列表</h2>
    <a href="/user/export" class="btn btn-success mb-3">导出CSV</a>
    <table class="table table-bordered table-hover">
        <thead>
            <tr>
                <th>客户编号</th>
                <th>姓名</th>
                <th>身份证号</th>
                <th>电话</th>
                <th>地址</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr th:each="user : ${users}">
                <td th:text="${user.customerID}"></td>
                <td th:text="${user.customerName}"></td>
                <td th:text="${user.pid}"></td>
                <td th:text="${user.telephone}"></td>
                <td th:text="${user.address}"></td>
                <td>
                    <a th:href="@{'/user/edit/' + ${user.customerID}}" class="btn btn-sm btn-primary">编辑</a>
                    <a th:href="@{'/user/delete/' + ${user.customerID}}" class="btn btn-sm btn-danger" onclick="return confirm('确定要删除该客户吗？')">删除</a>
                </td>
            </tr>
            <tr th:if="${#lists.isEmpty(users)}">
                <td colspan="6" class="text-center">暂无客户信息</td>
            </tr>
        </tbody>
    </table>
</div>
</body>
</html> 